export class ConfigMetaBase<T> {
    value: T;
    key: string;
    label: string;
    required: boolean;
    order: number;
    controlType: string;
    type: string;
    options: {value: string, text: string}[];
    group_name: string;
    tips: string;
    relation: string;

    constructor(options: {
        value?: T,
        key?: string,
        label?: string,
        required?: boolean,
        order?: number,
        controlType?: string,
        type?: string,
        options?: {value: string, text: string}[];
        group_name?: string;
        tips?: string;
        relation?: string;
      } = {}) {
      this.value = options.value;
      this.key = options.key || '';
      this.label = options.label || '';
      this.required = !!options.required;
      this.order = options.order === undefined ? 1 : options.order;
      this.controlType = options.controlType || '';
      this.type = options.type || '';
      this.options = options.options;
      this.group_name = options.group_name;
      this.tips = options.tips || '';
      this.relation = options.relation || '';
    }
  }